<ot-view>
    <div class="row">
        <div class="col-md-12 ot-view-title">
            <ot-entity-image entity="validationRun.validationStamp" link="#/validationStamp/{{validationRun.validationStamp.id}}">
                {{validationRun.validationStamp.name}}
            </ot-entity-image> run #{{validationRun.runOrder}}
        </div>
    </div>
    <table class="table table-hover">
        <tr ng-if="validationRun.data">
            <td colspan="4">
                <p>
                    Config ({{validationRun.data.descriptor.displayName}}):
                    <ot-validation-data-type-config value="validationStamp.dataType"></ot-validation-data-type-config>
                </p>
                <p>
                    Data:
                    <ot-validation-run-data value="validationRun.data"></ot-validation-run-data>
                </p>
            </td>
        </tr>
        <tr ng-repeat="validationRunStatus in validationRun.validationRunStatuses" ng-class="{info: $first}">
            <td>
                <ot-validation-run-status status="validationRunStatus"></ot-validation-run-status>
                {{validationRunStatus.statusID.name}}
            </td>
            <td>
                <ot-validation-run-status-comment status="validationRunStatus"></ot-validation-run-status-comment>
            </td>
            <td>
                <ot-signature value="{time: validationRunStatus.creation.time, user: {name: validationRunStatus.creation.user}}" user="true" time="true"></ot-signature>
            </td>
            <td>
                <button ng-if="validationRun._validationRunStatusChange && $first"
                        ng-click="validationRunStatusChange()"
                        class="btn btn-info pull-right">Change status</button>
                <button ng-if="!validationRun._validationRunStatusChange && $first"
                        disabled="disabled"
                        class="btn btn-default pull-right">Status change not possible</button>
            </td>
        </tr>
    </table>
    <div class="row">
        <div class="col-md-6">
            <ot-section-title>Properties</ot-section-title>
            <div class="row">
                <div class="col-md-12">
                    <ot-entity-properties entity="{_properties: validationRun.links._properties}"></ot-entity-properties>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <ot-section-title>Extra information</ot-section-title>
            <div class="row">
                <div class="col-md-12">
                    <ot-entity-extra entity="{_extra: validationRun.links._extra}"></ot-entity-extra>
                </div>
            </div>
        </div>
    </div>
</ot-view>